#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include<string>
using namespace std;

int main() {

    string s1;
    cin >> s1;
    long left = 0;
    long right = s1.size() - 1;
    string s2;
    while (left <= right)
    {
        if (left < right && s1[left] == s1[right])
        {
            left++;
            right--;
        }
        else {
            s2 += s1[left++];
            s2 += s1[right--];
        }

    }
    if (s2=="")
    {
        cout << 0;
    }
    else {

        cout << s2;
    }
    return 0;

}